/*
 * @Description: 
 * @Version: 2.0
 * @Autor: chululu
 * @Date: 2023-12-07 09:43:27
 * @LastEditors: chululu 835036768@qq.com
 * @LastEditTime: 2025-11-11 14:55:54
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import cesium from 'vite-plugin-cesium'; // 引入插件
import glsl from 'vite-plugin-glsl';
import UnoCss from 'unocss/vite';
// https://vitejs.dev/config/
export default defineConfig({
  base: './',
  plugins: [vue(), cesium(), glsl({
    include: '**/*.glsl', // 匹配所有的glsl文件
    compress: false, // 是否压缩代码，默认为false
  }), UnoCss({ configFile: './uno.config.js' }),//上面新建的那个文件的地址,
  ],
  resolve: {
    alias: {
      '@': '/src'
    }
  },
  server: {
    port: 8083,
    open: true,
    cors: true,
    proxy: {
      '/api': {
        target: 'http://localhost:8080',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
      '/terrain': {
        target: 'http://localhost:8082',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/terrain/, '')
      }
    }
  },

})
